From 53629d7a409992217eae8ac629911bc26e34689f Mon Sep 17 00:00:00 2001 From: robertl Date: Tue, 19 Jul 2005 22:05:18 +0000 Subject: [PATCH] Don't write empty routes. From Andrew. --- kml.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kml.c b/kml.c index 470e47714..3f79b98c0 100644 --- a/kml.c +++ b/kml.c @@ -199,7 +199,7 @@ static void kml_output_header(const route_head *header) write_optional_xml_entity(ofd, " ", "name", header->rte_name); write_optional_xml_entity(ofd, " ", "desc", header->rte_desc); - if (export_points) { + if (export_points && header->rte_waypt_ct > 0) { // Put the points in a subfolder fprintf(ofd, " \n"); fprintf(ofd, " 1\n"); @@ -238,16 +238,16 @@ static void kml_output_point(const waypoint *waypointp, const char *style) } -static void kml_output_tailer() +static void kml_output_tailer(const route_head *header) { int i; - if (export_points) { + if (export_points && point3d_list_len > 0) { fprintf(ofd, " \n"); } // Add a linestring for this track? - if (export_lines) { + if (export_lines && point3d_list_len > 0) { fprintf(ofd, "\t\n"); fprintf(ofd, "\t #lineStyle\n"); fprintf(ofd, "\t Path\n"); @@ -321,7 +321,7 @@ static void kml_track_disp(const waypoint *waypointp) static void kml_track_tlr(const route_head *header) { - kml_output_tailer(); + kml_output_tailer(header); } /* @@ -340,7 +340,7 @@ static void kml_route_disp(const waypoint *waypointp) static void kml_route_tlr(const route_head *header) { - kml_output_tailer(); + kml_output_tailer(header); } void kml_write(void) -- 2.30.2